package com.bingo.generate.cli.lccmd;

import com.bingo.generate.cli.OldUse;
import org.apache.commons.lang3.StringUtils;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.function.Consumer;

/**
 * ClassName
 * Description
 * Create by lc
 * Date 2021/7/9 17:07
 */
public class OldGenerateDb extends OldBaseCmd {

    public OldGenerateDb() {
        this.setName("自动根据db的数据库名称和表名称生成实体类");
    }

    @Override
    public void handler() {
        Scanner sc= OldUse.sc;
        Map<String, Consumer<String >> map=new HashMap<>();
        while (true){
            System.out.println(" -请输入你的命令(clb 查找表名, cgb 根据表名生成实体 ):");
            String str=sc.nextLine();
            //  去除空格
            str=StringUtils.trim(str);
            if(StringUtils.isBlank(str)){
                System.out.println("");
                continue;
            }
            //  清除空格
            if(str.equals("exit")){
                return;
            }

            /*GenDbCliArgs cliArgs=new GenDbCliArgs();
            */
            /*String[] args=str.split(" ");
            final CommandLine commandLine = new CommandLine(new GdbRootCommand());

            try {
                //CommandLine.populateCommand(cliArgs,args);
                //String[] args=str.split(" ");
                CommandLine.ParseResult result=commandLine.parseArgs(args);
            } catch (Exception e) {
                commandLine.usage(System.out);
                e.printStackTrace();
            }*/

        }
    }

    /*@CommandLine.Command(name = "gdb-cli",
            subcommands = {
                    // command1
                    CommandTest.testCommand.class,
                    // 添加 yourCommand.class
            },
            //  混合实例帮助
            mixinStandardHelpOptions = true
    )
    public class GdbRootCommand{

    }*/

}
